import api from '@/utils/request'
import type {ProtocolItemDO} from "@/type/toolLibs/protocol";

// 获取协议列表（支持分页）
export const getAllProtocolList = (data: any) => {
    return api.post('/Admin/protocolItem/getAll', data)
}

export const saveOrUpdateProtocolItem = (data: ProtocolItemDO) => {
    return api.post('/Admin/protocolItem/saveOrUpdate', data)
}

export const deleteProtocolItemById = (id: any) => {
    return api.post('/Admin/protocolItem/deleteById', {id: id})
}

export const getProtocolItemById = (id: string) => {
    return api.get('/Admin/protocolItem/getById?id=' + id)
}

// 分类相关
export const getProtocolCategory = () => {
    return api.get('/Admin/protocolCategory/list')
}

export const saveOrUpdateProtocolCategory = (data: any) => {
    return api.post('/Admin/protocolCategory/saveOrUpdate', data)
}

export const deleteProtocolCategoryById = (id: any) => {
    return api.post('/Admin/protocolCategory/delete', {id: id})
}


